<template>
  <h1>Shop展示:</h1>
  <button @click="getShopList">点击加载shop</button>
  <hr />
  <h2>shop列表</h2>
  <ul>
    <li v-for="item in shopList" :key="item.num">
      {{ item.title }} - {{ item.num }}
      <br />
    </li>
  </ul>
</template>

<script setup>
import API from '../axios/api.js'
import { ref } from 'vue'
const shopList = ref()
async function getShopList() {
  const res = await API.getRouter()
  shopList.value = res.data.data.routerData
}
// onMounted(()=>{
//     getShopList();
// })
</script>
